import matplotlib.pyplot as plt
import numpy as np

length = 0.5
nx = 10
deltaX = length/nx
x = [i*deltaX for i in range(nx+1)]
print(x)
y = []
for i in x:
    y.append(800*i + 100)
print(y)
analytic=plt.plot(x, y,label="Analytic")

x_of = np.loadtxt("/Users/tongyanjun/tttt-v2306/tttt_solver/matrixDumpFoam/cavity/tttt/x_extract.txt")
y_of = np.loadtxt("/Users/tongyanjun/tttt-v2306/tttt_solver/matrixDumpFoam/cavity/tttt/y_extract.txt")

numrical_of=plt.scatter(x_of,y_of,marker='o',color='r',label="Numerical OpenFOAM")

plt.legend()
plt.xlabel("length")
plt.ylabel("Temperature")
plt.title("Temperature Profile---Matrix Assemble Test")
plt.show()
